using System;
using System.Collections.Generic;
using System.Text;
using DslFactory.Utilities.DteCodeModel;

namespace Dslfactory.wcfLanguage
{
 public partial class ServicesDefinition
 {
  /// <summary>
  /// Find a service contract (or interface) of given name in the model
  /// </summary>
  internal ServiceContract FindServiceContractOfFullName(string fullname)
  {
   foreach (ServiceContract s in Interfaces)
    if (s.FullName == fullname)
     return s;
   return null;
  }

  /// <summary>
  /// Find an interface of givent full name in the model
  /// </summary>
  internal Interface FindInterfaceOfFullName(string fullname)
  {
   foreach (Interface s in this.Interfaces)
    if (s.FullName == fullname)
     return s;
   return null;
  }

  internal DataContract FindDataContractOfFullName(string fullname)
  {
   foreach (DataContract c in this.DataContracts)
    if (c.FullName == fullname)
     return c;
   return null;
  }

  internal Service FindServiceOfFullName(string fullname)
  {
   foreach (Service c in Services)
    if (c.FullName == fullname)
     return c;
   return null;
  }


  internal MessageContract FindMessageContractOfFullName(string fullname)
  {
   foreach (MessageContract m in MessageContracts)
    if (m.FullName == fullname)
     return m;
   return null;
  }
 }
}
